package org.jaaksi.customviewdemo

import android.os.Bundle
import android.util.Log
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        println(Test2.string)
        Log.e("cccc",">> ${Test2.string}")

        Test2.string = "1111"

        tabStripView.apply {
            topText = "Current"
            firstText = "Skinny"
            lastText = "Extra"
            onSelectedListener = {
                Toast.makeText(this@MainActivity, "选中了第${it}个", Toast.LENGTH_SHORT).show()
            }
            setCount(7)
            setSelectPosition(2)
        }
        btnChange.setOnClickListener {
            tabStripView.setSelectPosition(6)
        }
    }
}

object Test2 {
    var string = ""
}